﻿using Common.SqlSugar;
using MyBlog.IService;
using MyBlog.Model.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyBlog.Service
{
    public class UserService : BaseService<User>, IUserService
    {
        ISqlSugarClient _db;
        public UserService(ISqlSugarClient db) : base(db)
        {
            _db = db;
        }

        public async Task<bool> IsExistUserName(string name)
        {
            var users= Context.Queryable<User>().Where(u => u.Name == name).ToList();
            return users.Count==0?false : true;
        }
    }
}
